#include<iostream>
#include<vector>
using namespace std;
bool dfs(int x, int y, vector<vector<int> >& board, int count)
{
    if (count == 3) return true;
    if (x == 2 || y == 2)
    {
        return false;
    }
    else {
        if (board[x][y] == 1) count++;
        return dfs(++x, y, board, count) || dfs(x, ++y, board, count);
    }
}
bool checkWon(vector<vector<int> > board) {
    // write code here
    int x = 0, y = 0;
    return dfs(x, y, board, 0);
}

int main()
{
    vector<vector<int> > board{ {1,0,1},{1,-1,-1},{1,-1,0} };
    cout << checkWon(board) <<endl;
    return 0;
}
